package com.mongo.configuration;

/**
 * @ClassName TransactionConfig
 * @Description TODO
 * @Author louby0923
 * @Date 2024/2/4 10:19
 * @Version 1.0
 */

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.MongoDatabaseFactory;
import org.springframework.data.mongodb.MongoTransactionManager;

/**
 * 配置事务管理器
 * https://blog.csdn.net/baidu_35410857/article/details/131705220
 *
 * @author mydlq
 */
@Configuration
public class TransactionConfig {

    @Bean
    MongoTransactionManager transactionManager(MongoDatabaseFactory dbFactory) {
        return new MongoTransactionManager(dbFactory);
    }
}


